﻿using System;

namespace IupNET
{
    public class ProgressBar:Control
    {
        public ProgressBar()
            : base(Iupc.ProgressBar())
        {

        }

        public bool Dashed
        {
            get
            {
                return GetAttribute("DASHED") == "YES";
            }
            set
            {
                SetAttribute("DASHED", value ? "YES" : "NO");
            }
        }

        public bool Marquee 
        {
            get
            {
                return GetAttribute("MARQUEE") == "YES";
            }
            set
            {
                SetAttribute("MARQUEE", value ? "YES" : "NO");
            }
        }

        public double Min
        {
            get
            {
                return (double)Iupc.GetFloat(cobject, "MIN");
            }
            set
            {
                SetAttribute("MIN", Convert.RealToString(value));
            }
        }

        public double Max
        {
            get
            {
                return (double)Iupc.GetFloat(cobject, "MAX");
            }
            set
            {
                SetAttribute("MAX", Convert.RealToString(value));
            }
        }

        public Orientation Orientation
        {
            get
            {
                if (GetAttribute("ORIENTATION") == "VERTICAL")
                    return Orientation.Vertical;
                return Orientation.Horizontal;
            }

            set
            {
                if (value == Orientation.Vertical)
                    SetAttribute("ORIENTATION", "VERTICAL");
                else
                    SetAttribute("ORIENTATION", "HORIZONTAL");
            }
        }

        public new double Value
        {
            get
            {
                return (double)Iupc.GetFloat(cobject, "VALUE");
            }
            set
            {
                SetAttribute("VALUE", Convert.RealToString(value));
            }
        }

    }
}
